home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14615 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.0 KB

  1. Path: news.compuserve.com!newsmaster
  2. From: steve <steve72@compuserve.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: C++ experts only
  5. Date: Sun, 31 Mar 1996 17:00:26 +0000
  6. Organization: martian onclave
  7. Message-ID: <315EBA2A.1EFC@compuserve.com>
  8. References: <4jhrb4$gk2@melon.myna.com> <4jkiua$pki@dfw-ixnews1.ix.netcom.com>
  9. NNTP-Posting-Host: ad32-153.compuserve.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.01 (WinNT; I)
  14.  
  15. John Lilley wrote:
  16. > In article <4jhrb4$gk2@melon.myna.com>, ckhan@myna.com says...
  17. > >
  18. > >If you are such an expert, tell me why C++ is so great or not so great as
  19. > >compared to Structured C.
  20. > Golly, such an attitude...  But it DID get an answer...
  21. > One could be glib and claim that there are NO disadvantages to C++ vs C because
  22. > C++ is a superset of C, but I don't that it what our dear friend is asking.
  23. > One could also claim that C++ or any language is no better than the most
  24. > primitive assembler because they are all (within resource limits),
  25. > Turing-machine equivalent, but that is not the answer either, I fear.
  26. > I assert that C++ is an improvement over C because:
  27. > 1) It's type system and the safety guarantees therein are more complete and
  28. > allows one to write more reliable code.
  29. > 2) It is more powerful and requires less typing and other such tedium to
  30. > express groupings of data and operations on data as classes instead of data
  31. > structures and functions.
  32. > 3) C++ provides a uniform framework of object creation and destruction
  33. > regardless of the physical location (stack, heap or global).  That uniform
  34. > treatment reduces the number of loose ends that crop up when using objects that
  35. > have various lifetimes.
  36. > 4) Inheritance and the polymorphism supported by virtual methods are powerful
  37. > constructs that reduce the amount of tedium and/or type-violations that are
  38. > needed to express operations upon similar classes of objects.
  39. > 5) Templates are great IMHO, because they allow one to write a type-safe
  40. > container once and use it for many objects (although at the possible expense of
  41. > code size).
  42. > 6) Type-safe linkage reduces stupid errors due to mismatching of headers.
  43. > 7) Overridable new/delete allow one to alter the behavior of memory allocation
  44. > in a systematic manner.
  45. > 8) Method/function inlining is as efficient as macros (in most cases), but does
  46. > not suffer the semantic and syntactic nasty side-effects of macros.
  47. > 9) Method inlining for access to data members is as efficient as a simple
  48. > pointer-indirection, but allows for access protection or future upgrades to the
  49. > access that are more complex than pointer-indirection.
  50. > But this is all stuff you could have read in any intro to C++ book.  I think
  51. > that the reasons are compelling -- why not go buy some books and check it out
  52. > for yourself?
  53. > john lilley
  54.  
  55.  
  56.   And of course, Microsoft uses it(c++).
  57. To think of the time I've saved with MFC and other objects
  58. I've used.  I'd say C is surpassed by C++ with little question.
  59.  
  60. steve
  61.